<template>
  <div class="container mb70">
    <p class="bread">
      <a href="#/index/cm-law-list" class="font-s-18" v-show="this.$route.query.type==='chief'">首席监控师-法律服务订单</a>
      <a href="#/index/law-order-manage" class="font-s-18" v-show="this.$route.query.type==='business'">业务管理部-法律服务订单</a>
      <a href="#/index/law-notice" class="font-s-18" v-show="this.$route.query.type==='lawNotice'">业务管理部-法律服务通知</a>
    </p>
    <div class="bg-c-fff box-border">
      <h3 class="tm-title">法律服务订单详情</h3>
      <step :stepData="stepData" :stepNum="stepNum" @stepRouter="stepRouter"></step>
    </div>
    <div class="content bg-c-fff tc">
      <img src="../assets/sh.png" alt="" class="db auto">
      <p class="tc">监控师正在绘制交易监控流程图，请耐心等待。
        <br>流程图绘制成功后，自动进入交易监控阶段</p>
    </div>
  </div>
</template>
<script type="text/javascript">
import Step from '../components/Step'
export default {
  components: {
    Step
  },
  data() {
    return {
      stepNum: 1,
      stepData: [{
        name: '法律服务通知单'
      }, {
        name: '绘制流程图'
      }, {
        name: '法律服务监控'
      }, {
        name: '服务完成'
      }],
      status: ''
    }
  },
  mounted() {
    this.$http.get('/legalService/read/detail', {
      params: {
        id: this.$route.query.id
      }
    }).then(data => {
      if (data.data.httpCode === 200) {
        this.status = data.data.data.status
      } else {
        this.$toasted.show(data.data.msg)
      }
    }).catch(err => {
      console.log(err)
      this.$toasted.show('网络出错')
    })
  },
  methods: {
    stepRouter(i, name) {
      if (i === 0 && this.status >= 2) {
        this.$router.push('/cm-law-notice?type=' + this.$route.query.type + '&id=' + this.$route.query.id)
      }
      if (i === 1 && this.status >= 2) {
        this.$router.push('/cm-law-drawing?type=' + this.$route.query.type + '&id=' + this.$route.query.id)
      }
      if (i === 2 && this.status >= 3) {
        this.$router.push('/cm-law-monitor?type=' + this.$route.query.type + '&id=' + this.$route.query.id)
      }
      if (i === 3 && this.status >= 4) {
        this.$router.push('/cm-law-complete?type=' + this.$route.query.type + '&id=' + this.$route.query.id)
      }
    }
  }
}

</script>
<style type="text/css" scoped>
.content {
  padding: 50px 0;
  margin-top: 20px;
}

.content p {
  margin-top: 30px;
  color: #989696;
}

</style>
